//案例一

// var obj = {
//   age: "ziheng",
//   eating: function () {
//     console.log(this.age + " is eating");
//   },
//   running: function () {
//     console.log(this.age + " is running");
//   },
// };
// obj.eating();
// obj.running();

// var fn = obj.eating;
// fn();

//案例二

var obj1 = {
  age: "1",
  foo: function () {
    console.log(this.age);
  },
};

var obj2 = {
  age: "2",
  foo: obj1.foo,
};
obj2.foo();
